package com.csnf.controller;

import com.csnf.service.StorageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/storage")
public class StorageController {

    @Autowired
    StorageService  storageService;

    //减库存
    @RequestMapping("/reduceStorage")
    public String reduceStorage(String productCode,Integer count){
        int r = storageService.reduceStorage(productCode,count);
        if (r > 0){
            return "库存扣减成功";
        }else {
            return "库存扣减失败";
        }

    }

}
